#ifndef _LIGHT_H_
#define _LIGHT_H_

#include <GL/glew.h>
#include <GL/glut.h>

#define SHADOW_WIDTH 128
#define SHADOW_HEIGHT 128

class Light
{
public:
	Light();
	Light(float px, float py, float pz,
		  float dx, float dy, float dz);
	void setupMatrices();
	void setAsPOV();
	void genFBO();
	void updateMatrix();
	
	GLuint getDepthId();
	void beginDraw();
	void endDraw();
	void use(int unit);
	
	void setPosition(float x, float y, float z);
		GLuint depth;
	GLdouble MV[16];
	GLdouble P[16];
	GLuint fbo;
	void drawDebug(int x, int y, int w, int h);
private:
	float pos[3];
	float dir[3];
	GLdouble BMVP[16];
	

};

#endif
